package com.example.demo_mysql_mybatisplus.util.easyexcel.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * 布尔枚举
 */
@Getter
@AllArgsConstructor
public enum BoolEnum {
    /** 描述 */
    NUll(-1 , ""),
    FALSE(0 , "否"),
    TURE(1 , "是"),
    ;

    /** 状态码 */
    private Integer code;

    /** 状态描述 */
    private String desc;

    // 枚举值的描述信息
    public static final String[] DESC_ARR = new String[BoolEnum.values().length];
    // 描述对应枚举映射
    public static final Map<String,BoolEnum> DESC_MAP = new HashMap<>(BoolEnum.values().length);

    static {
        BoolEnum[] boolEnumArr  =BoolEnum.values();
        for (int i = 0; i < boolEnumArr.length; i++) {
            DESC_ARR[i] =boolEnumArr[i].getDesc();
            DESC_MAP.put(boolEnumArr[i].getDesc(),boolEnumArr[i]);
        }
    }


}